package com.ykq.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ykq.dao.StaffDao;
import com.ykq.entity.Staff;
import com.ykq.service.StaffService;
import com.ykq.vo.StaffVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: keyboard
 * @description:
 * @author: 闫克起2
 * @create: 2023-07-20 15:35
 **/
@Service
public class StaffServiceImpl implements StaffService {
    @Autowired
    private StaffDao staffDao;
    public Staff findByNameAndPwd(String username, String password) {
        Staff staff = staffDao.selectByUsernameAndPassword(username, password);
        return staff;
    }

    public PageInfo<Staff> findAll(Integer currentPage, Integer pageSize, StaffVo staffVo) {
        PageHelper.startPage(currentPage,pageSize);
        List<Staff> list = staffDao.select(staffVo);
        PageInfo<Staff> pageInfo=new PageInfo<Staff>(list);
        return pageInfo;
    }
}







